import request from './request'

/**
 * 获取通知列表
 * @param {Object} params
 * @param {number} params.pageNum - 页码
 * @param {number} params.pageSize - 每页大小
 * @returns {Promise}
 */
export function getNotificationList (params) {
  return request({
    url: '/notification/list',
    method: 'get',
    params
  })
}

/**
 * 标记通知为已读
 * @param {number} id - 通知ID
 * @returns {Promise}
 */
export function markAsRead (id) {
  return request({
    url: `/notification/read/${id}`,
    method: 'put'
  })
}

/**
 * 标记所有通知为已读
 * @returns {Promise}
 */
export function markAllAsRead () {
  return request({
    url: '/notification/read/all',
    method: 'put'
  })
}

/**
 * 获取未读通知数量
 * @returns {Promise}
 */
export function getUnreadNotificationCount () {
  return request({
    url: '/notification/unread/count',
    method: 'get'
  })
}
